finding the length of a curve